package com.isoftstone.common.dao;


import com.isoftstone.bank.entity.PAd;
import com.isoftstone.common.Page;
import com.isoftstone.common.entity.SysRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by admin on 16/5/11.
 *
 */

@Repository
public interface SysRoleMapper {

    SysRole getRoleById(@Param("roleId") String roleId)throws Exception;

    SysRole getRoleByCode(@Param("roleCode") String roleCode)throws Exception;

    List<SysRole> getRolelistPage(Page page) throws Exception;
    
    List<SysRole> getRole() throws Exception;


    public void saveRole(SysRole role)throws Exception;

    public void updateRole(SysRole role)throws Exception;

    /**批量删除
     * @param roleId
     * @throws Exception
     */
    public void deleteRole(String roleId)throws Exception;

    /**
     * @param comCode
     * @return
     * @throws Exception
     */
    List<SysRole> getSysRole(@Param("comCode") String comCode) throws Exception;

    List<SysRole> getCompanyRoles(@Param("empCode") String empCode, @Param("comCode") String comCode) throws Exception;

    SysRole getRoleByCorpIdAndUserId(@Param("corpId") String corpId, @Param("userId") String userId)throws Exception;

    void  updateRoleByidAndcorpId(@Param("roleId") int roleId, String corpId) throws Exception;

    String getParentRoleIdByRoleid(@Param("roleId") String roleId) throws Exception;

    List<SysRole> getBankRolelistPage(Page page);

    List<SysRole> getRolelist(@Param("corpId") String corpId)throws Exception;

    String getRoleNameByRoleNameandCorpId(@Param("roleName") String roleName, @Param("corpId") String corpId)throws Exception;

    List<SysRole> getBankRoleTree();
}
